/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.gamecenter.sdk.activity;

import android.annotation.TargetApi;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.content.res.Resources.Theme;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.view.WindowManager.LayoutParams;
import com.qihoo.gamecenter.sdk.common.IDispatcherCallback;
import com.qihoo.gamecenter.sdk.common.a;
import com.qihoo.gamecenter.sdk.common.b;
import com.qihoo.gamecenter.sdk.common.c;
import com.qihoo.gamecenter.sdk.common.f;
import com.qihoo.gamecenter.sdk.common.i.j;
import com.qihoo.gamecenter.sdk.pay.DispatcherPay;
import org.json.JSONException;
import org.json.JSONObject;

public class ContainerActivity extends Activity implements b, c {
    private static final String TAG = "ContainerActivity";
    private b mControlInterface = this;
    private Intent mIntent = null;

    public void setActivityControl(b paramb) {
        if (paramb == null)
            return;
        this.mControlInterface = paramb;
    }

    protected void onCreate(Bundle paramBundle) {
        Intent localIntent = getIntent();
        this.mIntent = localIntent;
        String str = localIntent.getStringExtra("params");
        if (!(TextUtils.isEmpty(str))) {
            j.a("ContainerActivity", "floatbox params = " + str, new Object[0]);
            if (!(parseFloatInfo(str))) {
                super.onCreate(paramBundle);
                finish();
                return;
            }
        }
        boolean bool = null != paramBundle;
        localIntent.putExtra("has_saved_instance_state", bool);
        j.a("ContainerActivity", "ContainerActivity onCreate() called, hasSavedInstanceState = ",
                new Object[] { Boolean.valueOf(bool) });
        int i = localIntent.getIntExtra("function_code", 0);
        DispatcherPay localDispatcherPay = new DispatcherPay();
        localDispatcherPay.startOutSDK(this, i, this.mIntent);
        this.mControlInterface.onCreateControl(paramBundle);
    }

    private boolean parseFloatInfo(String paramString) {
        int i = 0;
        String str1 = "";
        String str2 = "";
        int j = 0;
        try {
            JSONObject localJSONObject1 = new JSONObject(paramString);
            JSONObject localJSONObject2 = localJSONObject1.optJSONObject("params");
            if (localJSONObject2 != null) {
                i = localJSONObject2.optInt("function_code");
                str1 = localJSONObject2.optString("url");
                str2 = localJSONObject2.optString("sms");
            }
        } catch (JSONException localJSONException) {
            j.d("ContainerActivity", localJSONException.toString(), new Object[0]);
        }
        j.a("ContainerActivity", "json: funcode:", new Object[] { Integer.valueOf(i), " url:", str1 });
        switch (i) {
        case 2061:
        case 2062:
        case 2063:
            j = 1;
            i = 2049;
            break;
        case 2057:
            if (!(TextUtils.isEmpty(str1)))
                i = 2049;
            break;
        case 2049:
        case 2059:
            break;
        case 526:
        case 527:
            if ("PAY".toLowerCase().contains("social")) {
                boolean bool = getResources().getConfiguration().orientation == 2;
                this.mIntent.putExtra("screen_orientation", bool);
            }
            else {
                return false;
            }
        default:
            j.c("ContainerActivity", "Unrecognized function code: ", new Object[] { Integer.valueOf(i) });
            return false;
        }
        if ((j != 0) && (TextUtils.isEmpty(str1)))
            return false;
        this.mIntent.putExtra("function_code", i);
        this.mIntent.putExtra("page_url", str1);
        this.mIntent.putExtra("page_from", "fuchuang");
        this.mIntent.putExtra("sms", str2);
        return true;
    }

    protected void onRestoreInstanceState(Bundle paramBundle) {
        this.mControlInterface.onRestoreInstanceStateControl(paramBundle);
    }

    protected void onPostCreate(Bundle paramBundle) {
        this.mControlInterface.onPostCreateControl(paramBundle);
    }

    public void onCreateControl(Bundle paramBundle) {
        super.onCreate(paramBundle);
    }

    protected void onStart() {
        super.onStart();
        this.mControlInterface.onStartControl();
    }

    protected void onRestart() {
        super.onRestart();
        this.mControlInterface.onRestartControl();
    }

    protected void onResume() {
        super.onResume();
        this.mControlInterface.onResumeControl();
    }

    protected void onPostResume() {
        this.mControlInterface.onPostResumeControl();
    }

    protected void onNewIntent(Intent paramIntent) {
        this.mControlInterface.onNewIntentControl(paramIntent);
    }

    protected void onSaveInstanceState(Bundle paramBundle) {
        this.mControlInterface.onSaveInstanceStateControl(paramBundle);
    }

    protected void onPause() {
        super.onPause();
        this.mControlInterface.onPauseControl();
    }

    protected void onUserLeaveHint() {
        this.mControlInterface.onUserLeaveHintControl();
    }

    protected void onStop() {
        super.onStop();
        this.mControlInterface.onStopControl();
    }

    public void onLowMemory() {
        this.mControlInterface.onLowMemoryControl();
    }

    public boolean onKeyLongPress(int paramInt, KeyEvent paramKeyEvent) {
        return this.mControlInterface.onKeyLongPressControl(paramInt, paramKeyEvent);
    }

    public boolean onKeyUp(int paramInt, KeyEvent paramKeyEvent) {
        return this.mControlInterface.onKeyUpControl(paramInt, paramKeyEvent);
    }

    public boolean onKeyMultiple(int paramInt1, int paramInt2, KeyEvent paramKeyEvent) {
        return this.mControlInterface.onKeyMultipleControl(paramInt1, paramInt2, paramKeyEvent);
    }

    public boolean onTouchEvent(MotionEvent paramMotionEvent) {
        return this.mControlInterface.onTouchEventControl(paramMotionEvent);
    }

    public boolean onTrackballEvent(MotionEvent paramMotionEvent) {
        return this.mControlInterface.onTrackballEventControl(paramMotionEvent);
    }

    public void onUserInteraction() {
        this.mControlInterface.onUserInteractionControl();
    }

    public void onWindowFocusChanged(boolean paramBoolean) {
        this.mControlInterface.onWindowFocusChangedControl(paramBoolean);
    }

    protected void onPrepareDialog(int paramInt, Dialog paramDialog) {
        this.mControlInterface.onPrepareDialogControl(paramInt, paramDialog);
    }

    protected void onDestroy() {
        super.onDestroy();
        this.mControlInterface.onDestroyControl();
        j.a("ContainerActivity", "onDestroy", new Object[0]);
    }

    public boolean onKeyDown(int paramInt, KeyEvent paramKeyEvent) {
        return this.mControlInterface.onKeyDownControl(paramInt, paramKeyEvent);
    }

    public void onContentChanged() {
        this.mControlInterface.onContentChangedControl();
    }

    public void onDetachedFromWindow() {
        this.mControlInterface.onDetachedFromWindowControl();
    }

    public View onCreatePanelView(int paramInt) {
        return this.mControlInterface.onCreatePanelViewControl(paramInt);
    }

    public boolean onCreatePanelMenu(int paramInt, Menu paramMenu) {
        return this.mControlInterface.onCreatePanelMenuControl(paramInt, paramMenu);
    }

    public boolean onCreateOptionsMenu(Menu paramMenu) {
        return this.mControlInterface.onCreateOptionsMenuControl(paramMenu);
    }

    public void onCreateContextMenu(ContextMenu paramContextMenu, View paramView,
            ContextMenu.ContextMenuInfo paramContextMenuInfo) {
        this.mControlInterface.onCreateContextMenuControl(paramContextMenu, paramView, paramContextMenuInfo);
    }

    public boolean onContextItemSelected(MenuItem paramMenuItem) {
        return this.mControlInterface.onContextItemSelectedControl(paramMenuItem);
    }

    public void onContextMenuClosed(Menu paramMenu) {
        this.mControlInterface.onContextMenuClosedControl(paramMenu);
    }

    protected Dialog onCreateDialog(int paramInt) {
        return this.mControlInterface.onCreateDialogControl(paramInt);
    }

    public void onConfigurationChanged(Configuration paramConfiguration) {
        this.mControlInterface.onConfigurationChangedControl(paramConfiguration);
    }

    public void onBackPressed() {
        this.mControlInterface.onBackPressedControl();
    }

    public void onAttachedToWindow() {
        this.mControlInterface.onAttachedToWindowControl();
    }

    protected void onApplyThemeResource(Resources.Theme paramTheme, int paramInt, boolean paramBoolean) {
        this.mControlInterface.onApplyThemeResourceControl(paramTheme, paramInt, paramBoolean);
    }

    protected void onTitleChanged(CharSequence paramCharSequence, int paramInt) {
        this.mControlInterface.onTitleChangedControl(paramCharSequence, paramInt);
    }

    protected void onChildTitleChanged(Activity paramActivity, CharSequence paramCharSequence) {
        this.mControlInterface.onChildTitleChangedControl(paramActivity, paramCharSequence);
    }

    public View onCreateView(String paramString, Context paramContext, AttributeSet paramAttributeSet) {
        return this.mControlInterface.onCreateViewControl(paramString, paramContext, paramAttributeSet);
    }

    public boolean onCreateThumbnail(Bitmap paramBitmap, Canvas paramCanvas) {
        return this.mControlInterface.onCreateThumbnailControl(paramBitmap, paramCanvas);
    }

    public CharSequence onCreateDescription() {
        return this.mControlInterface.onCreateDescriptionControl();
    }

    public Object onRetainNonConfigurationInstance() {
        return this.mControlInterface.onRetainNonConfigurationInstanceControl();
    }

    public void onWindowAttributesChanged(WindowManager.LayoutParams paramLayoutParams) {
        this.mControlInterface.onWindowAttributesChangedControl(paramLayoutParams);
    }

    public boolean onPreparePanel(int paramInt, View paramView, Menu paramMenu) {
        return this.mControlInterface.onPreparePanelControl(paramInt, paramView, paramMenu);
    }

    public boolean onMenuOpened(int paramInt, Menu paramMenu) {
        return this.mControlInterface.onMenuOpenedControl(paramInt, paramMenu);
    }

    public boolean onMenuItemSelected(int paramInt, MenuItem paramMenuItem) {
        return this.mControlInterface.onMenuItemSelectedControl(paramInt, paramMenuItem);
    }

    public void onPanelClosed(int paramInt, Menu paramMenu) {
        this.mControlInterface.onPanelClosedControl(paramInt, paramMenu);
    }

    public boolean onPrepareOptionsMenu(Menu paramMenu) {
        return this.mControlInterface.onPrepareOptionsMenuControl(paramMenu);
    }

    public boolean onOptionsItemSelected(MenuItem paramMenuItem) {
        return this.mControlInterface.onOptionsItemSelectedControl(paramMenuItem);
    }

    public void onOptionsMenuClosed(Menu paramMenu) {
        this.mControlInterface.onOptionsMenuClosedControl(paramMenu);
    }

    public boolean onSearchRequested() {
        return this.mControlInterface.onSearchRequestedControl();
    }

    protected void onActivityResult(int paramInt1, int paramInt2, Intent paramIntent) {
        this.mControlInterface.onActivityResultControl(paramInt1, paramInt2, paramIntent);
    }

    public boolean hasWindowFocus() {
        return this.mControlInterface.hasWindowFocusControl();
    }

    public int getRequestedOrientation() {
        return this.mControlInterface.getRequestedOrientationControl();
    }

    public boolean dispatchTouchEvent(MotionEvent paramMotionEvent) {
        return this.mControlInterface.dispatchTouchEventControl(paramMotionEvent);
    }

    public boolean dispatchKeyEvent(KeyEvent paramKeyEvent) {
        return this.mControlInterface.dispatchKeyEventControl(paramKeyEvent);
    }

    public void overridePendingTransition(int paramInt1, int paramInt2) {
        this.mControlInterface.overridePendingTransitionControl(paramInt1, paramInt2);
    }

    public void onRestoreInstanceStateControl(Bundle paramBundle) {
        super.onRestoreInstanceState(paramBundle);
    }

    public void onPostCreateControl(Bundle paramBundle) {
        super.onPostCreate(paramBundle);
    }

    public void onStartControl() {
        super.onStart();
    }

    public void onRestartControl() {
        super.onRestart();
    }

    public void onResumeControl() {
        super.onResume();
    }

    public void onPostResumeControl() {
        super.onPostResume();
    }

    public void onNewIntentControl(Intent paramIntent) {
        super.onNewIntent(paramIntent);
    }

    public void onSaveInstanceStateControl(Bundle paramBundle) {
        super.onSaveInstanceState(paramBundle);
    }

    public void onPauseControl() {
        super.onPause();
    }

    public void onUserLeaveHintControl() {
        super.onUserLeaveHint();
    }

    public void onStopControl() {
        super.onStop();
    }

    public void onLowMemoryControl() {
        super.onLowMemory();
    }

    @TargetApi(5)
    public boolean onKeyLongPressControl(int paramInt, KeyEvent paramKeyEvent) {
        return super.onKeyLongPress(paramInt, paramKeyEvent);
    }

    public boolean onKeyUpControl(int paramInt, KeyEvent paramKeyEvent) {
        return super.onKeyUp(paramInt, paramKeyEvent);
    }

    public boolean onKeyMultipleControl(int paramInt1, int paramInt2, KeyEvent paramKeyEvent) {
        return super.onKeyMultiple(paramInt1, paramInt2, paramKeyEvent);
    }

    public boolean onTouchEventControl(MotionEvent paramMotionEvent) {
        return super.onTouchEvent(paramMotionEvent);
    }

    public boolean onTrackballEventControl(MotionEvent paramMotionEvent) {
        return super.onTrackballEvent(paramMotionEvent);
    }

    public void onUserInteractionControl() {
        super.onUserInteraction();
    }

    public void onWindowFocusChangedControl(boolean paramBoolean) {
        super.onWindowFocusChanged(paramBoolean);
    }

    public void onPrepareDialogControl(int paramInt, Dialog paramDialog) {
        super.onPrepareDialog(paramInt, paramDialog);
    }

    public void onDestroyControl() {
        super.onDestroy();
    }

    public boolean onKeyDownControl(int paramInt, KeyEvent paramKeyEvent) {
        return super.onKeyDown(paramInt, paramKeyEvent);
    }

    public void onContentChangedControl() {
        super.onContentChanged();
    }

    @TargetApi(5)
    public void onDetachedFromWindowControl() {
        super.onDetachedFromWindow();
    }

    public View onCreatePanelViewControl(int paramInt) {
        return super.onCreatePanelView(paramInt);
    }

    public boolean onCreatePanelMenuControl(int paramInt, Menu paramMenu) {
        return super.onCreatePanelMenu(paramInt, paramMenu);
    }

    public boolean onCreateOptionsMenuControl(Menu paramMenu) {
        return super.onCreateOptionsMenu(paramMenu);
    }

    public void onCreateContextMenuControl(ContextMenu paramContextMenu, View paramView,
            ContextMenu.ContextMenuInfo paramContextMenuInfo) {
        super.onCreateContextMenu(paramContextMenu, paramView, paramContextMenuInfo);
    }

    public boolean onContextItemSelectedControl(MenuItem paramMenuItem) {
        return super.onContextItemSelected(paramMenuItem);
    }

    public void onContextMenuClosedControl(Menu paramMenu) {
        super.onContextMenuClosed(paramMenu);
    }

    public Dialog onCreateDialogControl(int paramInt) {
        return super.onCreateDialog(paramInt);
    }

    public void onConfigurationChangedControl(Configuration paramConfiguration) {
        super.onConfigurationChanged(paramConfiguration);
    }

    @TargetApi(5)
    public void onBackPressedControl() {
        super.onBackPressed();
    }

    @TargetApi(5)
    public void onAttachedToWindowControl() {
        super.onAttachedToWindow();
    }

    public void onApplyThemeResourceControl(Resources.Theme paramTheme, int paramInt, boolean paramBoolean) {
        super.onApplyThemeResource(paramTheme, paramInt, paramBoolean);
    }

    public void onTitleChangedControl(CharSequence paramCharSequence, int paramInt) {
        super.onTitleChanged(paramCharSequence, paramInt);
    }

    public void onChildTitleChangedControl(Activity paramActivity, CharSequence paramCharSequence) {
        super.onChildTitleChanged(paramActivity, paramCharSequence);
    }

    public View onCreateViewControl(String paramString, Context paramContext, AttributeSet paramAttributeSet) {
        return super.onCreateView(paramString, paramContext, paramAttributeSet);
    }

    public boolean onCreateThumbnailControl(Bitmap paramBitmap, Canvas paramCanvas) {
        return super.onCreateThumbnail(paramBitmap, paramCanvas);
    }

    public CharSequence onCreateDescriptionControl() {
        return super.onCreateDescription();
    }

    public Object onRetainNonConfigurationInstanceControl() {
        return super.onRetainNonConfigurationInstance();
    }

    public void onWindowAttributesChangedControl(WindowManager.LayoutParams paramLayoutParams) {
        super.onWindowAttributesChanged(paramLayoutParams);
    }

    public boolean onPreparePanelControl(int paramInt, View paramView, Menu paramMenu) {
        return super.onPreparePanel(paramInt, paramView, paramMenu);
    }

    public boolean onMenuOpenedControl(int paramInt, Menu paramMenu) {
        return super.onMenuOpened(paramInt, paramMenu);
    }

    public boolean onMenuItemSelectedControl(int paramInt, MenuItem paramMenuItem) {
        return super.onMenuItemSelected(paramInt, paramMenuItem);
    }

    public void onPanelClosedControl(int paramInt, Menu paramMenu) {
        super.onPanelClosed(paramInt, paramMenu);
    }

    public boolean onPrepareOptionsMenuControl(Menu paramMenu) {
        return super.onPrepareOptionsMenu(paramMenu);
    }

    public boolean onOptionsItemSelectedControl(MenuItem paramMenuItem) {
        return super.onOptionsItemSelected(paramMenuItem);
    }

    public void onOptionsMenuClosedControl(Menu paramMenu) {
        super.onOptionsMenuClosed(paramMenu);
    }

    public boolean onSearchRequestedControl() {
        return super.onSearchRequested();
    }

    public void onActivityResultControl(int paramInt1, int paramInt2, Intent paramIntent) {
        super.onActivityResult(paramInt1, paramInt2, paramIntent);
    }

    public void execCallback(String paramString) {
        long l = this.mIntent.getLongExtra("callback_id", 0L);
        IDispatcherCallback localIDispatcherCallback = a.a(l);
        if (localIDispatcherCallback == null)
            return;
        localIDispatcherCallback.onFinished(paramString);
    }

    @TargetApi(5)
    public void overridePendingTransitionControl(int paramInt1, int paramInt2) {
        super.overridePendingTransition(paramInt1, paramInt2);
    }

    public boolean dispatchKeyEventControl(KeyEvent paramKeyEvent) {
        return super.dispatchKeyEvent(paramKeyEvent);
    }

    public boolean dispatchTouchEventControl(MotionEvent paramMotionEvent) {
        return super.dispatchTouchEvent(paramMotionEvent);
    }

    public int getRequestedOrientationControl() {
        return super.getRequestedOrientation();
    }

    public boolean hasWindowFocusControl() {
        return super.hasWindowFocus();
    }
}